import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        StudentSheet studentSheet=new StudentSheet();
        ArrayList<Student> arr = new ArrayList<>();
        System.out.println("------------------------------------------------------");
        System.out.println("------------------------------------------------------");
        System.out.println("----------------欢迎进入学生成绩管理系统------------------");
        System.out.println("----------------     1.查询学生数量   ------------------");
        System.out.println("----------------     2.添加学生信息   ------------------");
        System.out.println("----------------     3.删除学生信息   ------------------");
        System.out.println("----------------     4.学号查找信息   ------------------");
        System.out.println("----------------     5.姓名查找信息   ------------------");
        System.out.println("----------------     6.绩点排序      ------------------");
        System.out.println("----------------     7.学生名单      ------------------");
        System.out.println("----------------     8.退出系统      ------------------");
        System.out.println("------------------------------------------------------");
        System.out.println("------------------------------------------------------");
        while (true){
            System.out.print("请输入操作方式1-8：");
            Scanner scanner=new Scanner(System.in);
            int n=scanner.nextInt();
            switch (n){
                case 1:
                    studentSheet.getNum(arr);
                    break;
                case 2:
                    studentSheet.addStu(arr);
                    break;
                case 3:
                    studentSheet.delete(arr);
                    break;
                case 4:
                    System.out.println(studentSheet.IDback(arr).toString());
                    break;
                case 5:
                    System.out.println(studentSheet.Nameback(arr).toString());
                    break;
                case 6:
                    studentSheet.getStuInfoList(arr);
                    break;
                case 7:
                    System.out.println(studentSheet.Show(arr));
                    break;
                case 8:
                    System.exit(0);
                default:
                    System.out.println("请重新选择操作：");
                    break;
            }
        }
    }

}
